table.insert(itemActions,
	function(item, action)
		-- MAGIC amulets
		-- see: dir .. "readme.txt" for information regarding these variables
		local priority = 2
		local identify = true
		local dump = true

		if not (item.quality == ItemQuality.Magic and item.baseItem.code == "amu") then
			return false
		elseif action == aPICK and (not item.flags.Identified or isGoodMagicAmulet(item)) then
			return priority
		elseif action == aIDENT then
			return identify
		elseif action == aSELL and item.flags.Identified and not isGoodMagicAmulet(item) then
			return true
		elseif action == aDUMP and item.flags.Identified and not isGoodMagicAmulet(item) then
			return dump
		end

		return false
	end
)

function isGoodMagicAmulet(item)
	-- no easy customs available for this
	-- feel free to change the lower prefix/suffix bounds
	local prefix, suffix, affix =  false, false, false
	local baalammy, dr = false, false
	
	for i = 0, item.mods:size() - 1 do
		if item.mods[i].Stat.Type == StatType.ClassSkillsBonus and
				item.mods[i].Value == 2 then -- 2sk->prefix
			affix = true
		elseif item.mods[i].Stat.Type == StatType.SkillTabBonus and
				item.mods[i].Value >= 2 then --  2-3sktab->prefix
			affix = true
		elseif item.mods[i].Stat.Type == StatType.FasterCastRate then
			suffix = true -- any fcr->suffix
		elseif (item.mods[i].Stat.Type == StatType.Strength or
				item.mods[i].Stat.Type == StatType.Dexterity or
				item.mods[i].Stat.Type == StatType.Energy) and
				item.mods[i].Value >= 15 then -- 20+str/dex/eng->suffix
			suffix = true
		elseif (item.mods[i].Stat.Type == StatType.MaxLife or
				item.mods[i].Stat.Type == StatType.MaxMana) and
				item.mods[i].Value >= 60 then -- 80+hp or mp->suffix
			suffix = true
		elseif item.mods[i].Stat.Type == StatType.MagicFind and
				item.mods[i].Value >= 25 then -- 40+mf->affix
			suffix = true
		elseif item.mods[i].Stat.Type == StatType.DamageReduction and
				item.mods[i].Value >= 8 then -- 10+DR->affix
			suffix = true
		elseif item.level >= 94 then
			baalammy = true
		end
	end

	return (
		   prefix or
		   suffix or
		   affix or
		   fcr
		   --or baalammy
		   )
end
